package tonytech.wordcode;

import tonytech.wordcode.controller.DocCodeMegerController;
import tonytech.wordcode.mode.FileInfoImpl;

import javax.swing.*;
import java.io.File;

/**
 * Created by hkl on 17-1-22.
 */
public class DocCodeMegerFunc {
    public static void main(String[] args) {

        JFileChooser chooserDialog=new JFileChooser();
        chooserDialog.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);//只能选择目录
        chooserDialog.showOpenDialog(null);
        File dir = chooserDialog.getSelectedFile();
        if (dir==null) return;
       chooserDialog=new JFileChooser();
        chooserDialog.showOpenDialog(null);
        File destFile = chooserDialog.getSelectedFile();
        if (destFile==null) return;

        DocCodeMegerController controller
                = new DocCodeMegerController();
        DocCodeMegerController.DocCodeMegerContext
                context = new DocCodeMegerController.DocCodeMegerContext(
                        dir.getAbsolutePath(),
                        destFile.getAbsolutePath()
        );
        controller.service(context);

    }
}
